import lanxizhen from "@/assets/lanxizhen.json"
/** echarts
     * map
     * geojson
     * */
    areaEchartsFn() {
      echarts.registerMap('lanxizhen', this.lanxizhenJson);
      let chartDom = document.getElementById('areaEcharts')
      let myChart = echarts.init(chartDom)
      let option = {
        backgroundColor: 'transparent',
        geo: {
          map: 'lanxizhen',
          aspectScale: 0.75, //长宽比
          zoom: 0.9,
          roam: false,
          itemStyle: {
            normal: {
              areaColor: '#013C62',
              shadowColor: '#67eaf9',
              shadowOffsetX: 0,
              shadowOffsetY: 20
            },
            emphasis: {
              areaColor: '#2AB8FF',
              borderWidth: 0,
              color: '#14c6ff',
              label: {
                show: false
              }
            }
          }
        },
        series: [{
          type: 'map',
          roam: true,
          label: {
            normal: {
              show: true,
              textStyle: {
                color: '#fff'
              }
            },
            emphasis: {
              textStyle: {
                color: '#fff'
              }
            }
          },

          itemStyle: {
            normal: {
              borderColor: '#68f9ff',
              borderWidth: 2.5,
              areaColor: '#35a2ea'
            },
            emphasis: {
              areaColor: '#0296fa',
              borderWidth: 0,
              color: '#14c6ff'
            }
          },
          zoom: 0.9,
          roam: false,
          map: 'lanxizhen' //使用
        },
        ]
      };
      if (option && typeof option === 'object') {
        myChart.setOption(option)
      }
      window.addEventListener('resize', () => {
        myChart.resize()
      })
    }